<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>16.Math数学计算</title>
</head>

<body>
  <script>
    //Math
    //最大值。
    console.log(Math.max(1, 2, 3, 4, 5)); //5   
    //数组最大值
    console.log(Math.max.apply(Math, [12, 3, 2, 124, 5]));  //124
    //向上取整
    console.log(Math.ceil(5.01)); //6  
    //向下取整
    console.log(Math.floor(5.01)); //5 
    //四舍五入
    console.log(Math.round(5.56));//6

  </script>
</body>

</html>